import React from 'react';
import {message} from 'antd';

const token = "123456"
/*localStorage.getItem("token");*/
export function login(url, data) {
    const urls = "/oauth/token?username=161106004&password=admin&client_id=c1&client_secret=secret&grant_type=password"
    fetch(urls,{
        method: 'get',
        headers: {
            "content-type": "application/x-www-form-urlencoded",
            "token":token,
        },
       /* body: JSON.stringify(data={
            username: data['username'],
            password: data['password'],
            client_id: 'c1',
            client_secret: 'secret',
            grant_type: 'password'
        }),*/

    }).then((res)=>{
            return res;
        })
        .catch((e)=>{
            message.error("未知错误！");
            console.log(e)
        })

}
